package top.soulblack.purchasesale.controller.stock;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.soulblack.purchasesale.common.Result;
import top.soulblack.purchasesale.model.VO.InOrderVO;
import top.soulblack.purchasesale.service.InOutOrderService;

import static top.soulblack.purchasesale.common.CodeMsg.INODER_NOT_EXIST;

/**
 * @Author: 韦溜溜
 * @Description:
 * @Date: Create in 17:13 2019/8/30
 */
@Controller
@RequestMapping("/in_order")
public class InOrderController {

    @Autowired
    private InOutOrderService inOutOrderService;

    @PostMapping("/getOne")
    @ResponseBody
    public Result<InOrderVO> getOne(String orderId){
       InOrderVO inOrderVO = inOutOrderService.getOneInOrderVO(orderId);
        if (inOrderVO!=null) {
            return Result.success(inOrderVO);
        }
        return Result.error(INODER_NOT_EXIST);
    }

}
